package xuanke;

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Student stu = new Student();
		Teacher teach = new Teacher();
		Choice cho = new Choice();
		Course cour = new Course();
		Scanner s = new Scanner(System.in);
		System.out.println("请输入学号！");
		String xuehao = s.next();
		System.out.println("输入 0 查看老师信息,输入 1 查看学生信息,输入 2 查看课程信息,输入 3 进行选、退课");
		int i = s.nextInt();
		if(i==0) {
			for(int t=1;t<=teach.teacher.size();t++) {
				System.out.println("请输入老师编号！");
				String n = s.next();
				if(teach.teacher.containsKey(n)) {
					teach.ShowTeacher(n);
				}
				else {
					System.out.println("学校未开设此课！");
					continue;
				}
			}
		}
		
		if(i==1) {
			stu.ShowStuInfo(xuehao);
		}
		if(i==2) {
			for(int t=1;t<=cour.courseInfo.size();t++) {
				System.out.println("请输入课程编号！");
				String n = s.next();
				if(cour.courseInfo.containsKey(n)) {
					cour.ShowCourseInfo(n);
				}
				else {
					System.out.println("学校未开设此课！");
					continue;
				}
			}
		}
		if(i==3) {
			cho.Xuanke(stu,cour);
			cho.TuiKe(stu,cour);
			if(stu.stuCourseInfo.size()<5) {
				cho.bxu(stu, cour);	
			}
			else {
				System.out.println("五门课已选完！");
			}
		    
		}
		System.out.println("是否需要打印你的选课信息，需要请输入1，退出请输入其他");
		int k = s.nextInt();
		if(k==1) {
			stu.ShowStuInfo(xuehao);
			stu.ShowStuCourseInfo();
		}
		else {
			System.out.println("已退出");
		}

     }
}